﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using DTN.Core;
using Hanel.DTN.News;
using System.Data;
using System.Data.SqlClient;

/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {

    public WebService () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string insertComment(int Content_ID,string HoTen,string Email,string TieuDe,string NoiDung) {
        string output = "";
        output = themmoi(Content_ID, HoTen, Email, TieuDe, NoiDung);
        return output;
    }
    private string themmoi(int Content_ID, string HoTen, string Email, string TieuDe, string NoiDung)
    {
        string output = "";
        ItblCommentManager obj = tblCommentManager.CreateInstance();
        tblComment comment = new tblComment();
        comment.active = 0;
        comment.com_create = DateTime.Now;
        comment.Content_ID = Content_ID;
        comment.Email = Email;
        comment.HoTen = HoTen;
        comment.TieuDe = TieuDe;
        comment.NoiDung = NoiDung;
        obj.InserttblComment(comment);
        output = TieuDe;

        return output;
    }

}
